﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Interfaces;
using System.Configuration;
using SQLDao;

namespace DAOBase
{
    public class DaoFacade
    {
        private IDaoFactory factory;

        public DaoFacade()
        {
            var data_src = "SQL"; // ConfigurationManager.AppSettings["DataSource"];
            if (data_src == null)
                throw new ConfigException();

            switch (data_src)
            {
                case "SQL":
                    factory = new SQLDaoFactory();
                    break;
                default:
                    throw new ConfigException();
            }
        }

        public IDaoFactory GetFactory()
        {
            return factory;
        }
    }
}
